﻿@{
    TempData["SidebarType"] = "MyNotice";
    IEnumerable<SelectListItem> statusSelect = ViewData.Get<List<SelectListItem>>("statusSelect", new List<SelectListItem>());
}
<div class="row jh-space-setup">
    @Html.Partial("_Sidebar")
    <div class="col-xs-10">
        <div class="jh-space-right jh-padding-white">
            <div class="tn-title">
                <h4>我的通知</h4>
            </div>
            <div class="jh-notice-btn">
                <div class="row">
                    <div class="col-xs-9">
                        <div class="checkbox">
                            <label>
                                <input type="checkbox" id="selectAll"> 全选
                            </label>
                        </div>

                        <button type="button" class="btn btn-default know">标记已读</button>
                        <button type="button" class="btn btn-default delete-notice">批量删除</button>
                    </div>
                    <div class="col-xs-3">
                        @Html.DropDownList("statusSelect", statusSelect, new { @class = "form-control" })
                    </div>
                </div>
            </div>
            <div class="jh-notice-list" id="showNotice">
                @Html.Action("_MyNotice", "UserSpace", new RouteValueDictionary(new { status = NoticeStatus.Unhandled }))
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    require(['jquery', 'tnlayer'], function ($, tnlayer) {
 
    //下拉菜单事件
    $("#statusSelect").change(function () {
        var status = $("#statusSelect option:selected").val();
        $.get("@CachedUrlHelper.Action("_MyNotice", "UserSpace")", { status: status, requestTime: new Date().getTime() }, function (data) {
            if (data) {
                $("#showNotice").html(data);
            }
        })
    })
    })
</script>